<?php /*a:2:{s:55:"/www/wwwroot/llz/application/admin/view/config/set.html";i:1601119706;s:58:"/www/wwwroot/llz/application/admin/view/public/father.html";i:1708691164;}*/ ?>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <style>*{font-weight: 300;}</style>
    
</head>
<body>

<div style="margin: 15px;">
    
<style>
    .layui-form-pane .layui-form-text{padding: 0 10px;}
    .layui-form-pane .layui-form-label{background: none !important;padding-left: 2px;border: 0;color:#000;}
    .layui-form-pane .layui-form-text input, .layui-form-pane .layui-form-text textarea{border-radius: 3px !important;}
</style>

<div class="layui-tab layui-tab-card">

    <ul class="layui-tab-title">

        <?php foreach($system_config as $k=>$v): if($k == 'base'): ?>

        <li <?php echo input('param.group')=='base'||input('param.group') == null?' class="layui-this"':''; ?>>
        <a href="<?php echo url('admin/config/set'); ?>?group=<?php echo htmlentities($k); ?>"><?php echo htmlentities($v); ?></a>
        </li>

        <?php else: ?>

        <li <?php echo input('param.group')==  $k  ?' class="layui-this"':''; ?>>
        <a href="<?php echo url('admin/config/set'); ?>?group=<?php echo htmlentities($k); ?>"><?php echo htmlentities($v); ?></a>
        </li>

        <?php endif; ?>

        <?php endforeach; ?>

    </ul>

    <div class="layui-tab-content" style="background: #FFFFFF;">

        <form class="layui-form layui-form-pane" action="">
            <?php foreach($data as $v): if($v['type'] == 'input'): ?>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <input type="text" name="<?php echo htmlentities($v['name']); ?>" value="<?php echo htmlentities($v['value']); ?>" placeholder="请输入<?php echo htmlentities($v['title']); ?>" autocomplete="off" class="layui-input">
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'textarea'): ?>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <textarea name="<?php echo htmlentities($v['name']); ?>" placeholder="请输入<?php echo htmlentities($v['title']); ?>" class="layui-textarea"><?php echo htmlentities($v['value']); ?></textarea>
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'switch'): ?>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <input type="checkbox" name="<?php echo htmlentities($v['name']); ?>" value="1" lay-skin="switch" lay-text="<?php echo !empty($v['options'][1]) ? htmlentities($v['options'][1]) : '启用'; ?>|<?php echo !empty($v['options'][0]) ? htmlentities($v['options'][0]) : '禁用'; ?>" <?php echo $v['value']==1 ? ' checked' : ''; ?>>
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'radio'): ?>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <?php foreach($v['options'] as $kk => $vv): ?>
                    <input type="radio" name="<?php echo htmlentities($v['name']); ?>" value="<?php echo htmlentities($kk); ?>" title="<?php echo htmlentities($vv); ?>" <?php if($kk == $v['value']): ?>checked<?php endif; ?>>
                    <?php endforeach; ?>
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'checkbox'): ?>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <?php foreach($v['options'] as $kk => $vv): ?>
                    <input type="checkbox" name="<?php echo htmlentities($v['name']); ?>[]" value="<?php echo htmlentities($kk); ?>" title="<?php echo htmlentities($vv); ?>" lay-skin="primary" <?php if(in_array($kk, $v['value'])): ?>checked<?php endif; ?>>
                    <?php endforeach; ?>
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'select'): ?>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <select name="<?php echo htmlentities($v['name']); ?>" lay-verify="required">
                        <?php foreach($v['options'] as $kk => $vv): ?>
                        <option value="<?php echo htmlentities($kk); ?>" <?php if($kk == $v['value']): ?>selected<?php endif; ?>><?php echo htmlentities($vv); ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'image'): ?>
            <div class="layui-form-item layui-form-text upload">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-block">
                    <input type="text" name="<?php echo htmlentities($v['name']); ?>" value="<?php echo htmlentities($v['value']); ?>" placeholder="请上传<?php echo htmlentities($v['title']); ?>" autocomplete="off" class="layui-input upload-input">
                    <div style="position: absolute;right: 0px;top: 0px;">
                        <img class="upload-img" src="<?php echo htmlentities($v['value']); ?>" style="max-height: 36px;" onclick="showImg(this.src);"><button type="button" class="layui-btn layui-btn-primary upload-button"><i class="layui-icon layui-icon-upload"></i>上传图片</button>
                    </div>
<!--                    <button type="button" class="layui-btn layui-btn-primary upload-button" style="position: absolute;right: 0px;top: 0px;"><i class="layui-icon layui-icon-upload"></i> 上传图片</button>-->
                    <!--                <img onclick="showImg(this.src);" class="upload-img" src="<?php echo htmlentities($v['value']); ?>" style="height: 38px;">-->
                </div>
            </div>

            <?php endif; if($v['type'] == 'file'): ?>

            <?php endif; if($v['type'] == 'tags'): ?>

            <?php endif; if($v['type'] == 'hidden'): ?>

            <?php endif; if($v['type'] == 'array'): ?>
            <div class="layui-form-item">
                <label class="layui-form-label"><?php echo htmlentities($v['title']); ?></label>
                <div class="layui-input-inline">
                    <textarea class="layui-textarea" name="<?php echo htmlentities($v['name']); ?>" autocomplete="off" placeholder="请填写<?php echo htmlentities($v['title']); ?>"><?php echo htmlentities($v['value']); ?></textarea>
                </div>
                <?php if(!empty($v['tip'])): ?>
                <div class="layui-form-mid layui-word-aux"><?php echo htmlspecialchars_decode($v['tips']); ?></div>
                <?php endif; ?>
            </div>
            <?php endif; if($v['type'] == 'datetime'): ?>

            <?php endif; if($v['type'] == 'date'): ?>

            <?php endif; if($v['type'] == 'time'): ?>

            <?php endif; ?>

            <?php endforeach; ?>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="doit">立即提交</button>
                </div>
            </div>
        </form>

    </div>
</div>

</div>

<script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/layuiadmin/layui/layui.js" type="text/javascript"></script>
<script src="/static/js/public.js" type="text/javascript"></script>

<script>
    layui.use(['table', 'layer', 'form'], function() {
        var table = layui.table,
            layer = layui.layer,
            form = layui.form,
            $ = layui.jquery;

        //监听提交
        form.on('submit(doit)', function(data){
            $.post("<?php echo url(); ?>?group=<?php echo input('param.group','base'); ?>", data.field, function(res) {
                if(res.code == 1) {
                    success(res.msg);
                } else {
                    error(res.msg);
                }
            }, 'json');
            return false;
        });
    });
</script>

</body>
</html>